package mac5789.hamcycle;

import mac5789.utils.Range;

/**
 * Experimento de ciclos hamiltonianos
 * 
 * @author lundberg
 * 
 */
public class HamCycleExperiment {

    private final HamCycleMeasurer measurer;

    private final int vertexes;

    private final Range degrees;

    public HamCycleExperiment(HamCycleMeasurer measurer, int vertexes, Range degrees) {
        super();
        this.measurer = measurer;
        this.vertexes = vertexes;
        this.degrees = degrees;
    }

    public void execute() {
        for (Integer degree : this.degrees) {
            HamCycleMeasurement measurement = this.measurer.measure(this.vertexes, degree);
            System.out.println(String.format("Degrees: %s Satisfiability: %s Average time: %s", degree, measurement.getSatisfiable(), measurement
                    .getAverageTime()));
        }
    }
}
